package com.example.demo.controller;

import com.example.demo.entity.Person;
import com.example.demo.mapper.PersonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kaixuan.xu
 * @version 1.0.0
 * @date 2018/12/14 13:05
 * @description
 */
@RestController
public class DemoController {

  @Autowired
  private PersonMapper personMapper;

  @GetMapping("person")
  public Person getPerson() {
    Person person = new Person();

    return personMapper.findPersonList(person).get(0);
  }
}
